**# Bookmark #1 Setting

*Windows
global root  = "G:/Dropbox/Environmental Injustice/Empirical"
global rawdata = "$root/rawdata"
global workdata = "$root/workdata"
global results = "$root/results"
global outfile = "$root/outfile"

cd "$workdata"


**# Bookmark #2

use "$outfile/City_regression.dta",clear

swindex belowhs belowcl rural occupation,flip(occupation) gen(swindex)

xtile swindex_5=swindex,nq(5)

rename swindex_5 swindex_quantile

	forvalues k=1/5{
	gen swindex5_`k'=1 if swindex_quantile==`k'
	replace swindex5_`k'=0 if swindex_quantile!=`k'
	}	

gen swindex1=swindex5_1*post
gen swindex2=swindex5_2*post
gen swindex3=swindex5_3*post
gen swindex4=swindex5_4*post
gen swindex5=swindex5_5*post

reghdfe codemission o.swindex1 swindex2 swindex3 swindex4 swindex5,absorb(i.city i.province#i.year) cluster(i.province i.year)
est store swindex

coefplot swindex, keep(swindex*) levels(95) omitted vertical ///
xlabel(1 "1" 2 "2" 3 "3" 4 "4" 5 "5",labsize(*1) labcolor(black)) ///
recast(scatter) lcolor(black) lpattern(-) ///
ciopts(recast(rcap) lcolor(edkblue*0.8)) ///
mlcolor(black) mfcolor(white) msize(*1.2) msymbol(oh) ///
yline(0,lcolor(edkblue*0.6) lwidth(*1.0)) ///
ylabel(,nogrid tposition(crossing) tlcolor(gs10)) ///
graphregion(color(gs16)) plotr(lcolor(edkblue) lpattern(1) lwidth(*1.5)) ///
ytitle("Coefficient",size(large)) xtitle("Quantiles of Baseline Low-SES Population Shares",size(large))

graph export "$results/Fig. S4.pdf", as(pdf) name("Graph") replace